package com.shuaibiao.base.utils.aop;

import java.util.HashMap;
import java.util.Map;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 全局捕获异常类
 * @author yin.jinbiao
 *
 */
//@ControllerAdvice
public class GlobalExceptionHandler {
	/**
	 * RuntimeException表示拦截运行时异常,基于异常通知
	 * @return
	 */
	@ExceptionHandler(RuntimeException.class)
	@ResponseBody
	public Map<String,Object> resultError(){
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("errorCode", "500");
		map.put("errorMsg", "系统错误");
		return map;
	}
	
}
